{include 'header.tpl'}
<link href="/admin/css/goods.css" rel="stylesheet" >
<div class="row no-margin">
    <div class="col-lg-12 col-sm-12 col-xs-12 no-padding">
        <div class="widget flat no-margin">
            <div class="widget-header widget-fruiter">
                <div class="pull-right">
                    <a class="btn btn-success" id="save" href="javascript:void(0);">发布商品</a>
                </div>
            </div><!--Widget Header-->
            <div class="widget-body plugins_goods-">
                <div class="row">
                    <div class="col-lg-12 col-sm-12 col-xs-12">
                        <form class="tabbable" id="form"   method="post" autocomplete="off" enctype="multipart/form-data">
                            <ul class="nav nav-tabs tabs-flat">
                                <li class="active">
                                    <a href="#tab-basic" data-toggle="tab">
                                        商品信息
                                    </a>
                                </li>
                                <li>
                                    <a href="#tab-pic" data-toggle="tab">
                                        商品图片
                                    </a>
                                </li>
                                <li>
                                    <a href="#tab-detail" data-toggle="tab">
                                        商品描述
                                    </a>
                                </li>
                            </ul>
                            <div class="tab-content tabs-flat">
                                <div class="tab-pane active" id="tab-basic">
                                    {include "goods/add/base.tpl"}
                                </div>
                                <div class="tab-pane" id="tab-pic">
                                    {include "goods/add/pic.tpl"}
                                </div>
                                <div class="tab-pane" id="tab-detail">
                                    {include "goods/add/detail.tpl"}
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div><!--Widget Body-->
        </div><!--Widget-->
    </div>
</div>
{literal}
<script>
    $(document).ready(function(){
        $('#save').click(function(){
            var form = document.getElementById('form');
            if($.validateOnSubmit(form) == true){
                form.submit();
            }
        });

        $(this).on('blur','input',function(){
            if($.validateOnChange(this) === true){
                if($(this).parent().hasClass('has-error')){
                    $(this).parent().removeClass('has-error');
                }
            }else{
                if(!$(this).parent().hasClass('has-error')){
                    $(this).parent().addClass('has-error');
                }
            }
        });
    });
</script>
{/literal}
{include 'footer.tpl'}